package com.ssy.wireless.web.vo.req;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
public class MessageAuthQueryVo {
    private String area;
    private String mobile;
    private String userName;
    private String hotspotName;
    private String requestBeginTime;
    private String requestEndTime;
    private String sendBeginTime;
    private String sendEndTime;

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getHotspotName() {
        return hotspotName;
    }

    public void setHotspotName(String hotspotName) {
        this.hotspotName = hotspotName;
    }

    public String getRequestBeginTime() {
        return requestBeginTime;
    }

    public void setRequestBeginTime(String requestBeginTime) {
        this.requestBeginTime = requestBeginTime;
    }

    public String getRequestEndTime() {
        return requestEndTime;
    }

    public void setRequestEndTime(String requestEndTime) {
        this.requestEndTime = requestEndTime;
    }

    public String getSendBeginTime() {
        return sendBeginTime;
    }

    public void setSendBeginTime(String sendBeginTime) {
        this.sendBeginTime = sendBeginTime;
    }

    public String getSendEndTime() {
        return sendEndTime;
    }

    public void setSendEndTime(String sendEndTime) {
        this.sendEndTime = sendEndTime;
    }

    public Map<String, Object> queryParams() {
        Map<String, Object> params = new HashMap();
        params.put("mobile", StringUtils.hasLength(this.getMobile()) ? "%" + this.getMobile() + "%" : null);
        params.put("hotspotName", StringUtils.hasLength(this.getHotspotName()) ? "%" + this.getHotspotName() + "%" : null);
        params.put("area", StringUtils.hasLength(this.getArea()) ? "%" + this.getArea() + "%" : null);
        params.put("requestBeginTime", StringUtils.hasLength(this.getRequestBeginTime()) ? this.getRequestBeginTime() + " 00:00:00" : null);
        params.put("requestEndTime", StringUtils.hasLength(this.getRequestEndTime()) ? this.getRequestEndTime() + " 23:59:59" : null);
        params.put("sendBeginTime", StringUtils.hasLength(this.getSendBeginTime()) ? this.getSendBeginTime() + " 00:00:00" : null);
        params.put("sendEndTime", StringUtils.hasLength(this.getSendEndTime()) ? this.getSendEndTime() + " 23:59:59" : null);
        return params;
    }
}
